<!DOCTYPE html>
<html>
  <style>
 html{
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, #a8edea 0%, #fed6e3 100%);
    background-repeat: no-repeat;
  }
  </style>

<body >
  <header>
    <h1 class="logo" style="color: red;"> 名字：
      <label id="username"></label>
      <br>
      <label id="sn"></label> <br>
      <label id="sex"></label> <br>
      <label id="pswd"></label>
    </h1>
  </header>
  <script>
    function getInfo() {
      let userinfo = localStorage.getItem("userinfo");
      if(userinfo == null){
        alert("本页面需要先登录");
        window.location.href = "/login";
        return 
      }
      let user = JSON.parse(userinfo);
      document.getElementById("username").textContent = user.Name;
      document.getElementById("sn").textContent = user.Sn;
      document.getElementById("sex").textContent = user.Sex;
      document.getElementById("pswd").textContent = user.Pswd;
    }
    getInfo()
  </script>
</body>

</html>